android.device
Class MagManager

java.lang.Object
  extended by android.device.MagManager

public class MagManager
extends java.lang.Object


Constructor Summary
MagManager()
           
 
Method Summary
 int checkCard()
          check if a card swipe action has taken place
 int close()
          Close the MSR reader
 int getAllStripInfo(byte[] info)
          Get information on all 3 strips
 int getSingleStripInfo(int strip, byte[] info)
          Get specific strip information
 int open()
          Open the MSR reader
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MagManager

public MagManager()
Method Detail

open

public int open()
Open the MSR reader

Returns:
Open operation is successful, negative number if operation is not successful

close

public int close()
Close the MSR reader

Returns:
0 if OK. negative number if failed.

checkCard

public int checkCard()
check if a card swipe action has taken place

Returns:
0 if card swipe action has been detected, negative number if swipe action has not been detected

getAllStripInfo

public int getAllStripInfo(byte[] info)
Get information on all 3 strips

Parameters:
info - to store the information. The information is organized in TLV (tag length value) format. tag is 1 byte, with the following meaning. 01 - strip 1, 02 - strip 2, 03 - strip 3
Returns:
length of information. 0 length if not information is available.

getSingleStripInfo

public int getSingleStripInfo(int strip,
                              byte[] info)
Get specific strip information

Parameters:
strip - number, could be 1 or 2 or 3
info - to store the strip information
Returns:
eturns the length of information